/***************************************************************
 * Name:      QtHelper
 * Purpose:   Code::Blocks plugin
 * Author:    Sviridov Michael Alexandrovich (2mihail@mail.ru)
 * Created:   2008-09-20
 * Copyright: Sviridov Michael Alexandrovich
 * License:   GPL
 **************************************************************/
#ifndef QTPRJGEN_H_INCLUDED
#define QTPRJGEN_H_INCLUDED
//-----------------------------------------------------------
// Created by Sviridov Michael Alexandrovich
//-----------------------------------------------------------
#include <map>
#include <list>
#include <wx/arrstr.h>
#include <cbproject.h>
//-----------------------------------------------------------
class Compiler;
class cbProject;
class ProjectBuildTarget;
//-----------------------------------------------------------
class QtPrjGen
{
private:
	typedef std::map<wxString, std::list<wxString> > VARS_LIST;
	VARS_LIST config;

	Compiler *compiler;
	cbProject *project;
	ProjectBuildTarget *target;

	std::list<wxString>& str_arr2list(const wxArrayString &arr, std::list<wxString> &lst);
	std::list<wxString>& get_values(const wxString &nm);
	void set_values(const wxString &nm, const std::list<wxString> &values);
	void add_value(const wxString &nm, const wxString &value);
	wxString& mk_quoted_str(wxString& str, bool force = 1);
	//wxString extractGlobalsIfAny(const wxString &str);

	bool check_target();
	bool check_has_files();
	bool check_compiler();
	bool save2pro(const wxString &fn);
	void fill_compiler_opts();
	void fill_linker_opts();
	void fill_libs();
	void check_libs(std::list<wxString> &libs);
	void fill_lib_dirs();
	void check_lib_dirs(std::list<wxString> &lib_dirs);
	void fill_include_dirs();
	void check_include_dirs(std::list<wxString> &inc_dirs);
	void fill_prj_files();
	void fill_config();

public:
	bool create_pro(cbProject *prj, const wxString &fn);
};
//-----------------------------------------------------------
#endif // QTPRJGEN_H_INCLUDED
